/*
 *  glfuncs.h
 *  framework
 *
 *  Created by gerhard gubler on 17.11.09.
 *  Copyright 2009 md80.ch . All rights reserved.
 *
 */
#ifndef GLFUNCS_H
#define GLFUNCS_H
#include <OpenGL/gl.h>
#include <GLUT/glut.h>
#include <string>
#include "vscrtext.h"

using std::string;

#define TEXTURES_NUM 10       // We Have 1 Texture (NEW) 
#define CUBE_TEX     0       // Our Cube Texture Index (NEW)

// A Structure For RGB Bitmaps
typedef struct _RGBIMG {
	GLuint   w;    // Image's Width
	GLuint   h;    // Image's Height
	GLubyte* data; // Image's Data (Pixels)
} RGBIMG;

class glfuncs
{
#define GLRED   1.0,0.0,0.0
#define GLBLUE  0.0,0.5,1.0
#define GLGREEN 0.0,1.0,0.0
	
	GLfloat rotx;
	GLfloat txtrot;
	GLfloat intcount;
	char *hundred;
	char *ten;
	char *one;
	char *one_up;
	char *one_down;
	GLuint	g_texid[TEXTURES_NUM]; // Our Textures' Id List (NEW)
	string text_name;
	
public:
	vscrtext myvsc;
	glfuncs();
	void line(GLfloat, GLfloat, GLfloat, float);
	void frame1(GLfloat, GLfloat, GLfloat);
	void box2(GLfloat, GLfloat, GLfloat);
	void box3(GLfloat, GLfloat, GLfloat , GLfloat);
	void text(GLfloat, GLfloat, std::string );
	void text2(GLfloat, GLfloat, std::string );
	void call_vsc(GLfloat, GLfloat, float);
	void flush();
	void test();
	void set_num_textures(int);
	bool load_rgb_image(const char*, int , int , RGBIMG*);
	bool setup_textures(int, int, int);
	void showtexture(GLfloat, GLfloat, int);
	void set_Texture_name(string);
};

#endif